package com.lizhenhua.orderitemquery.controller;

import com.lizhenhua.fmmall.entity.OrderItem;
import com.lizhenhua.orderitemquery.service.QueryOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class QueryOrderItemController {
    @Autowired
    private QueryOrderItemService service;

    @GetMapping("/query/orderitem/{orderId}")
    public List<OrderItem> queryOrderItem(@PathVariable("orderId") String orderId){
        System.out.println("------------------执行了query-orderitem  查询订单快照根据订单");

        return service.queryOrderItem(orderId);
    }
}
